<template>
  <div>
    <video
      :src="section.video"
      width="640"
      height="480"
      controls="controls"
    ></video>
  </div>
</template>
<script>
import { add_playhistory_post, section_get } from './axios_api/api';
export default {
  data() {
    return {
      sid: '', //小节id
      section: {}, // 小节内容
    }
  },
  mounted() {
    this.sid = this.$route.query.sid
    this.get_section()

    // this.play_history()

  },
  methods: {
    get_section() {
      // 获取小节的内容
      section_get({ id: this.sid }).then((resp) => {
        this.section = resp
        this.play_history()
      })
    },
    play_history() {
      // 播放记录, 
      add_playhistory_post({ sid: this.sid }).then((resp) => {
        console.log(resp)
      })
    }
  }
}
</script>